<?php

namespace app\api\controller;


use think\Controller;
use think\Db;

class Consult extends Controller
{

    // 咨询
    public function addConsult()
    {
        $param = input('param.');
        $validate = validate('LoginValidate');
        if (!$validate->scene('consult')->check($param)){
            return json(msg(0,'',$validate->getError()));
        }
        $param['create_time']=time();
        $res = Db::name('consult')->insert($param);
        if ($res){
            return json(msg(1,'','咨询成功'));
        }else{
            return json(msg(0,'','咨询失败'));
        }
    }
}
